package com.unidt.www.module.expert.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 * @Author sk
 * @Description:
 * @Date 2022/12/16 13:22
 **/
@Data
public class ShieldingConditionVo {


    @ApiModelProperty("屏蔽单位")
    private String unitNames;

    @ApiModelProperty("屏蔽姓名")
    private String names;

    @ApiModelProperty("相同单位仅限一名专家")
    private Boolean  isUnitLimit;

    /**
     *
     * @return
     */
    public List<String> shieldingNames(){
        if(StringUtils.isNotBlank(names)){
            return Arrays.asList(names.split("[,]"));
        }
        return Collections.emptyList();
    }


    /**
     * 获取屏蔽单位
     * @return
     */
    public List<String> shieldingUnitNames(){
        if(StringUtils.isNotBlank(unitNames)){
            return Arrays.asList(unitNames.split("[,]"));
        }
        return Collections.emptyList();
    }


}
